package com.itachi.common.swagger.config;


import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.ArrayList;
import java.util.List;


@Getter
@Setter
@ConfigurationProperties("swagger")
public class SwaggerProperties {

    private boolean enable; //是否开启

    private String basePackage = ""; // swagger解析的包路径

    private List<String> basePath = new ArrayList<>(); // swagger会解析的url规则

    private List<String> excludePath = new ArrayList<>(); //basePath中需要排除的url规则

    private String title = "";

    private String description = "";

    private String version = "";

    private String license = "";

    private String licenseUrl = ""; // 许可证URL

    private String termsOfServiceUrl = ""; // 服务条款URL

    private String host = "";

    private Contact contact = new Contact(); // 联系人信息

    private Authorization authorization = new Authorization(); // 全局统一鉴权配置


    @Getter
    @Setter
    static class Contact
    {
        private String name = "";

        private String url = "";

        private String email = "";
    }

    @Getter
    @Setter
    static class Authorization
    {
        private String name = "";

        private String authRegex = "^.*$";

        private List<AuthorizationScope> authorizationScopeList = new ArrayList<>();

        private List<String> tokenUrlList = new ArrayList<>();
    }

    @Getter
    @Setter
    static class AuthorizationScope
    {
        private String scope = "";

        private String description = "";
    }



}
